#include"process.h"
#include<time.h>
#include<stdlib.h>
double total =1024.0;    
double speed[]={10,1,10.4,1.6,3,2.4,8,0.2,10.3,2,4,2};
void download()
{
    srand(time(NULL));
    double current =0;
    while(current <=total)
    {
        flushprocess(total,current);
        if(current==total) break;
        int random=rand()%(sizeof(speed)/sizeof(int));
        usleep(10000);
        current+=speed[random]; 
        if(current>=total) current=total;
    }
    printf("\n");
}
int main()
{
   // process();
    download();
    return 0;
}
